package user.vo;

import com.google.common.base.Enums;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import user.contstant.FeedbackType;

/**
 * 用户评论
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FeedBack {

    /** 用户id*/
    private Long userId;
    /** 评论类型*/
    private String type;
    /** PassTemplate RowKey, 如果是app评论类型，则没有*/
    private String templateId;
    /** 评论内容*/
    private String comment;

    public boolean validate(){
        FeedbackType feedbackType = Enums.getIfPresent(
                FeedbackType.class,this.type.toUpperCase()
        ).orNull();
        return !(feedbackType == null || comment == null);
    }
}
